<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 对象才成立  简单数据类型是即使是==隐士转换也不会调用toString或者valueOf
      var a = {
        val: 1,
        toString() {
          return a.val++;
        },
      };
      console.log(a == 1 && a == 2 && a == 3);
    </script>
  </body>
</html>
